.PHONY: clean

CC:=gcc
CFLAGS:=-Wall -Os
LIB_PATH:=$(shell pwd)/libhv-v1.3.1
SRC:=$(wildcard ./*.c)
#OBJ:=$(SRC:%.c=%.o)
OBJ:=main.o
TARGET:=tftpd
LIBDIR:=${LIB_PATH}/install/lib
LIB:=libhv.a
INCLUDE_PATH:=${LIB_PATH}/install/include


$(TARGET):$(OBJ)
	$(CC) $(OBJ) -L$(LIBDIR) -l:$(LIB) -lpthread  -o $(TARGET) $(CFLAGS)
	
%.o:%.c
	$(CC) -std=c99 -c $^  -I$(INCLUDE_PATH)  -o $@ $(CFLAGS)
clean:
	rm *.o $(TARGET)
